#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
int main()
{
    int pid;
    printf("THIS IS %d MY PARENT=%d\n", getpid(),getppid());
    pid=fork();// fork syscall; parent returns child pid,if (pid){ // PARENT EXECUTES THIS PART
    if(pid)
    {
        printf("THIS IS PROCESS %d CHILD PID=%d\n", getpid(), pid);
    }
    else
    {
// child executes this part
        printf("this is process %d parent=%d\n", getpid(), getppid());
    }
}

